package org.csu.mypetstore.api.service.impl;

import com.alipay.api.AlipayApiException;
import org.csu.mypetstore.api.config.Alipay;
import org.csu.mypetstore.api.service.PayService;
import org.csu.mypetstore.api.vo.AlipayBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 支付服务
 */
@Service("payService")
public class PayServiceImpl implements PayService {

    @Autowired
    private Alipay alipay;

    /**
     * 支付宝支付接口
     * @param alipayBean
     * @return
     * @throws AlipayApiException
     */
    @Override
    public String aliPay(AlipayBean alipayBean) throws AlipayApiException {
        return alipay.pay(alipayBean);
    }
}
